﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using TechCrawler;

namespace SetProxy
{
    public partial class CheckIP : Form
    {
        public CheckIP()
        {
            InitializeComponent();
        }

        private void checkBtn_Click(object sender, EventArgs e)
        {

            ResultTxt.Text = string.Empty;
            HttpHelper helper = new HttpHelper();
            HttpItem item = new HttpItem();
            item.URL = urlTxt.Text;
            item.ProxyIp = IPTxt.Text + ":" + PortTxt.Text;
            HttpResult result = helper.GetHtml(item);
            if (result.StatusCode== System.Net.HttpStatusCode.OK)
            {
                ResultTxt.Text = result.Html;
            }
            else
            {
                ResultTxt.Text = result.StatusCode.ToString();
            }
        }
    }
}
